package cn.tedu.store.controller;

import cn.tedu.store.config.QRCode.QRCodeUtil;
import cn.tedu.store.entity.Meeting;
import cn.tedu.store.util.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 75936
 * @version 1.0
 * @project demo_hesuan
 * @description
 * @date 2023-01-05 15:20:26
 */
@Slf4j
@RestController
@RequestMapping("test")
public class MyTestController {

    @PostMapping(value = "/getQRCode")
    public JsonResult getQRCode(@RequestBody Meeting meeting){
        String code = QRCodeUtil.getCode(meeting.getMeetingCode());
        log.info("二维码输出的内容为{}",code);
        return new JsonResult(200,code);
    }
    @GetMapping("getTest")
    public String test01(){
        return "访问正常";
    }
}
